There are many devices that need to store information, such as data and code, in memory and other forms of nonvolatile storage, which need to periodically make updates. Such devices include, without limitation, a variety of computer systems, telecommunication devices, components of other devices, networking devices, memory cards, navigation devices, and the like.
In situations where the data stored in memory on such devices must be updated, it is important to employ a storage medium that is reprogrammable within the system. For example, storage systems used to hold data, such as file systems, databases, etc. may require modification. Storage mediums that are unable to be reprogrammed in the system, such as read-only memory (ROM) or EPROM to accommodate changes require a replacement of the storage medium.
A flash electrically erasable programmable read only memory (Flash EEPROM), hereinafter “flash memory” can be reprogrammed after being erased in-system. Flash memory may be erased in units of memory called blocks having memory cells and may be reprogrammed in bytes, words or double words. In order to erase one cell, an entire block of cells must be erased.
Devices that have updateable storage are susceptible to any failure occurring during the process of updating the files. For example, a power-loss may occur, such as a battery or charger that supplies energy to the device may run out of power. When power is lost during updating a file before the new version of the file has been completely written, the file may become corrupt and the data within the file left in an unusable state. The file will no longer be the original file or the final file. The device cannot recover by using the original file data because the old data might have been deleted or modified with a portion of the changed data. Thus, some prior upgrade processes are inherently unreliable because of the inability to return to a former valid state if an error occurs while updating to the new state. A reliable updating method on the other hand, is tolerant to such disruptions to the updating process.
Attempts to provide reliable updating of files typically require a backup copy of an entire file to be generated prior to changing the file. The backup copy restores the original if the file being updated becomes corrupted However, a problem with these prior methods is that the backup copy of the whole file needlessly consumes storage space equivalent to the original, where only a smaller portion of the data file may need to be added or modified Generally, the amount of storage available for maintaining a full copy is limited in devices that have data files comprising significant portions of the total storage available.
In general, the shortcomings of the currently available methods for modifying files are inadequate for providing reliable updates. In particular, previous methods require enough storage space for complete backups for the file(s) being updated.